package cn.mdmbct.douyin.common.proxy.invoker;

import cn.mdmbct.douyin.common.executor.ServiceExecutor;

import java.lang.reflect.Method;

/**
 * @author mdmbct  mdmbct@outlook.com
 * @date 5/10/2021 11:58 AM
 * @modified mdmbct
 * @since 1.0
 */
public class PlainMethodInvoker<T> implements ServiceMethodInvoker<T> {

    private final ServiceExecutor serviceExecutor;

    public PlainMethodInvoker(ServiceExecutor serviceExecutor) {
        this.serviceExecutor = serviceExecutor;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        return serviceExecutor.executor(method, args);
    }
}
